09. Exercise: Create The Database

Creating The Database

During this exercise, you'll set up your DB helper to create the database instance and provide the waitlist app with the database reference.

Exercise Code

Exercise: T07.02-Exercise-CreateTheDatabase

SOLUTION:
  • Modify WaitlistDbHelper to extend SQLiteOpenHelper.
  • Declare members for version number and database name.
  • Implement a constructor that takes a context object.
  • Implement onCreate by executing a create SQL statement.
  • Implement onUpgrade by dropping the DB and recreating it.